/**
 * 
 */
package tp.pr5.gui;

import tp.pr5.Controller;
import tp.pr5.RobotEngine;
import tp.pr5.Rotation;
import tp.pr5.instructions.DropInstruction;
import tp.pr5.instructions.Instruction;
import tp.pr5.instructions.MoveInstruction;
import tp.pr5.instructions.OperateInstruction;
import tp.pr5.instructions.PickInstruction;
import tp.pr5.instructions.QuitInstruction;
import tp.pr5.instructions.TurnInstruction;

/**
 * @author usuario_local
 *
 */
public class GUIController extends Controller {

	/**
	 * 
	 */
	
	private Instruction instruction;
	
	public GUIController(RobotEngine robot) {
		super(robot);
	}

	public void executeTurnAction(Rotation rotate)
	{
		this.instruction = new TurnInstruction(rotate);
		this.game.communicateRobot(this.instruction);		
	}
	public void executeOperateAction(String itemName)
	{
		this.instruction = new OperateInstruction(itemName);
		this.game.communicateRobot(this.instruction);
	}
	
	public void executeDropAction(String item)
	{
		this.instruction = new DropInstruction(item);
		this.game.communicateRobot(this.instruction);
	}
	
	public void executePickAction(String item)
	{
		this.instruction = new PickInstruction(item);
		this.game.communicateRobot(this.instruction);
	}
	
	public void executeQuitAction()
	{
		this.instruction = new QuitInstruction();
		this.game.communicateRobot(this.instruction);
	}
	
	public void executeMoveAction()
	{
		this.instruction = new MoveInstruction();
		this.game.communicateRobot(this.instruction);
	}
	
	@Override
	public void startController() {
		this.game.requestStart();
	}

	
}
